<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .container {
            width: 210px;
            height: 140px;
            position: relative;
            perspective: 1000px;
            margin-left: 500px;
            margin-top: 200px;
        }

        #carousel {
            width: 100%;
            height: 100%;
            position: absolute;
            transform-style: preserve-3d;
            -webkit-animation: move 5s infinite linear;
        }

        #carousel figure {
            display: block;
            position: absolute;
            width: 186px;
            height: 116px;
            left: 10px;
            top: 10px;
            border: 2px solid black;
        }
        #carousel figure:nth-child(1) { transform: rotateY(   0deg ) translateZ( 288px ); }
        #carousel figure:nth-child(2) { transform: rotateY(  40deg ) translateZ( 288px ); }
        #carousel figure:nth-child(3) { transform: rotateY(  80deg ) translateZ( 288px ); }
        #carousel figure:nth-child(4) { transform: rotateY( 120deg ) translateZ( 288px ); }
        #carousel figure:nth-child(5) { transform: rotateY( 160deg ) translateZ( 288px ); }
        #carousel figure:nth-child(6) { transform: rotateY( 200deg ) translateZ( 288px ); }
        #carousel figure:nth-child(7) { transform: rotateY( 240deg ) translateZ( 288px ); }
        #carousel figure:nth-child(8) { transform: rotateY( 280deg ) translateZ( 288px ); }
        #carousel figure:nth-child(9) { transform: rotateY( 320deg ) translateZ( 288px ); }

        @-webkit-keyframes move{
            from{transform: rotateX(0deg) rotateY(0deg);}
            to{transform: rotateX(0deg) rotateY(360deg);}
        }
    </style>
</head>
<body>
<section class="container">
    <div id="carousel">
        <figure style="background-color: #ff709d">1</figure>
        <figure style="background-color: #ffdeb5">2</figure>
        <figure style="background-color: #f591ff">3</figure>
        <figure style="background-color: #fffe89">4</figure>
        <figure style="background-color: #6fff78">5</figure>
        <figure style="background-color: #d473ff">6</figure>
        <figure style="background-color: #9bf0ff">7</figure>
        <figure style="background-color: #68ffa1">8</figure>
        <figure style="background-color: #afff84">9</figure>
    </div>
</section>
</body>
</html>